package net.hn.hnms.biz.fuel.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * Author: PanSX
 * Date: 2023/7/4 14:06
 */
@Entity
@Table(name = "environment_fuel", schema = "wscl", catalog = "huaneng-safety")
@ApiModel("废油处理")
@Data
public class Fuel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "custom-id")
    @GenericGenerator(name = "custom-id", strategy = "net.hn.hnms.biz.common.jpa.utils.CustomIDGenerator")
    @JsonSerialize(using = ToStringSerializer.class)
    private  Long id;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "Asia/Shanghai"
    )
    @ApiModelProperty("处置时间 yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "处置时间不能是空")
    private Date disposalTime;


    @ApiModelProperty("处置单位")
    @NotBlank(message = "处置单位不能是空")
    private String disposalDept;

    @ApiModelProperty("危险废物许可证编号")
    @NotBlank(message = "危险废物许可证编号不能是空")
    private String permit;

    @ApiModelProperty("名称")
    @NotBlank(message = "名称不能是空")
    private String name;

    @ApiModelProperty("规格型号")
//    @NotBlank(message = "规格型号不能是空")
    private String standard;

    @ApiModelProperty("单位")
    @NotBlank(message = "单位不能是空")
    private String unit;

    @ApiModelProperty("数量")
    @NotNull(message = "数量不能是空")
    private Integer number;

    @ApiModelProperty("经办人")
    @NotNull(message = "经办人不能是空")
    private String handle;

    @ApiModelProperty("处理单位联系人")
    @NotNull(message = "处理单位联系人不能是空")
    private String relatePerson;

    @ApiModelProperty("处理单位联系方式")
    @NotNull(message = "处理单位联系方式不能是空")
    private String relateDept;

    @ApiModelProperty("备注")
    private String remake;

    @ApiModelProperty("许可证扫描件")
    @NotNull(message = "请上传许可证扫描件")
    private String permitImg;


    private String mineCode;

    @Transient
    @ApiModelProperty("查询参数起始时间")
    private String beginTime;

    @Transient
    @ApiModelProperty("查询参数结束时间")
    private String endTime;

    @Transient
    @ApiModelProperty("煤矿名称 响应参数")
    private String mineName;

    private String companyCode;
    @Transient
    private String companyName;


}
